Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function |checked_div

std/ops/num::|checked_div


Usage

|checked_div<N>(a, b)

Generics

◻ N: CheckedDiv

Parameters

↳ a: N
↳ b: N

Return

Option<N>


Divide a by b, checking if division is possible or if overflow occurs

This function returns an option containing a ÷ b, or none if division is not possible (as division by 0), or result cause overflow in data type.